﻿
using Admin.NET.Core;
namespace Admin.NET.Plugin.ApprovalFlow;

/// <summary>
/// 审批流程节点规则配置表
/// </summary>
[SugarTable("approval_config","审批流程节点规则配置表")]
[SysTable]
public class ApprovalConfig  : EntityTenant
{
        
    /// <summary>
    /// 节点名称
    /// </summary>
    [SugarColumn(ColumnName = "node_name", ColumnDescription = "节点名称", Length = 100)]
    public string? node_name { get; set; }
    
    /// <summary>
    /// 表单ID 属于那个表单的流程
    /// </summary>
    [SugarColumn(ColumnName = "form_id", ColumnDescription = "表单ID 属于那个表单的流程", Length = 50)]
    public string? form_id { get; set; }
    
    /// <summary>
    /// 审批节点人员相同时自动通过[1：true；0：false]
    /// </summary>
    [SugarColumn(ColumnName = "approval_auto_pass", ColumnDescription = "审批节点人员相同时自动通过[1：true；0：false]")]
    public bool? approval_auto_pass { get; set; }
    
    /// <summary>
    /// 审批人类型[1:发起人自己；2:指定角色；3:指定人员；4:表单内人员]；注：1/3/4存userid、2存roleId
    /// </summary>
    [SugarColumn(ColumnName = "current_node_approver_type", ColumnDescription = "审批人类型[1:发起人自己；2:指定角色；3:指定人员；4:表单内人员]；注：1/3/4存userid、2存roleId")]
    public bool? current_node_approver_type { get; set; }
    
    /// <summary>
    /// 待审批人如果是角色就是角色ID，如果是其他则是userId格式：[xxx,xxx]
    /// </summary>
    [SugarColumn(ColumnName = "current_node_approver", ColumnDescription = "待审批人如果是角色就是角色ID，如果是其他则是userId格式：[xxx,xxx]", Length = 255)]
    public string? current_node_approver { get; set; }
    
    /// <summary>
    /// 允许审批人转交[1：true;2：false]
    /// </summary>
    [SugarColumn(ColumnName = "care_of", ColumnDescription = "允许审批人转交[1：true;2：false]")]
    public bool? care_of { get; set; }
    
    /// <summary>
    /// 审批类型[1:会签：2：或签]
    /// </summary>
    [SugarColumn(ColumnName = "approval_type", ColumnDescription = "审批类型[1:会签：2：或签]")]
    public bool? approval_type { get; set; }
    
    /// <summary>
    /// 审批节点[取值：1~N 从小到大；0：发起节点 、1：是第一个节点、 2：第二个节点 N：是第N个节点；最大的是结束节点]
    /// </summary>
    [SugarColumn(ColumnName = "approval_node", ColumnDescription = "审批节点[取值：1~N 从小到大；0：发起节点 、1：是第一个节点、 2：第二个节点 N：是第N个节点；最大的是结束节点]")]
    public int? approval_node { get; set; }
    
    /// <summary>
    /// 抄送人类型[1:发起人自己；2:指定角色；3:指定人员；4:表单内人员]
    /// </summary>
    [SugarColumn(ColumnName = "carbon_copy_recipients_type", ColumnDescription = "抄送人类型[1:发起人自己；2:指定角色；3:指定人员；4:表单内人员]")]
    public bool? carbon_copy_recipients_type { get; set; }
    
    /// <summary>
    /// 抄送人userId 数组格式
    /// </summary>
    [SugarColumn(ColumnName = "carbon_copy_recipients", ColumnDescription = "抄送人userId 数组格式", Length = 255)]
    public string? carbon_copy_recipients { get; set; }
    
    /// <summary>
    /// 规则创建时间；默认拿最新的
    /// </summary>
    [SugarColumn(ColumnName = "create_time", ColumnDescription = "规则创建时间；默认拿最新的")]
    public DateTime? create_time { get; set; }
    
    /// <summary>
    /// 分组[标识那些节点是同一个组的]
    /// </summary>
    [SugarColumn(ColumnName = "group_id", ColumnDescription = "分组[标识那些节点是同一个组的]", Length = 255)]
    public string? group_id { get; set; }
    
    /// <summary>
    /// 可见字段：[{"bt": false, "kj": true, "kx": true, "field": "create_time", "children": "purchase_requisition_details"}];kj:可见；kx:可写；kb:必填。如果是最后一个节点就需要单独拉一个配置
    /// </summary>
    [SugarColumn(ColumnName = "visible_fields", ColumnDescription = "可见字段：[{bt: false, kj: true, kx: true, field: create_time, children: purchase_requisition_details}];kj:可见；kx:可写；kb:必填。如果是最后一个节点就需要单独拉一个配置", Length = 0)]
    public string? visible_fields { get; set; }
    
}
